package net.neptech.model.workflow;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.DynamicUpdate;

import java.util.Date;

/**
 * @Author Saya
 * @Date 2025/8/18 14:33
 * @Description 工作流模板对象
 **/

@Entity
@Table(name = "workflow")
@Data
@AllArgsConstructor
@NoArgsConstructor
@DynamicUpdate
@Builder
@ToString
@TableName("workflow")
public class Workflow {

    @Id
    @TableId("flow_id")
    @GeneratedValue(strategy = GenerationType.UUID)
    private String flowId;

    @TableField("flow_name")
    private String flowName;

    @TableField("icon")
    private String icon;

    @TableField("group_id")
    private String groupId;

    @TableField("form_config")
    private String formConfig;

    @TableField("form_content")
    private String formContent;

    @TableField("flow")
    private String flow;

    @TableField("remark")
    private String remark;

    @TableField("sort")
    private Integer sort;

    @TableField("hidden")
    private Boolean hidden;

    @TableField("stop")
    private Boolean stop;

    @TableField("admin_id")
    private String adminId;

    @TableField("admin")
    private String admin;

    @TableField("range_show")
    private String rangeShow;
    //用于实现工作流版本控制
    @TableField("unique_id")
    private String uniqueId;
    @TableField("version")
    private Integer version;
    /**
     * 逻辑删除字段
     */
    @TableField("deleted")
    @Column(name = "deleted")
    private Boolean deleted;
    /**
     * 创建时间
     */
    @TableField("create_time")
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    @Column(name = "update_time")
    private Date updateTime;
}
